<?php
require('includes/top.php');
$disapproved_id = $_REQUEST['disapprove_id'];
$user_id = $_REQUEST['user_id'];
$depot_location = $_REQUEST['depot_location'];
$date = date("d-m-y");
/*$sql="INSERT INTO disapproved_accessories(`accessories_id`,`user_id`,`date`,`user_name`) VALUES ('$disapproved_id','$user_id','$date','".$_SESSION['user_name']."')";
$result=mysql_query($sql);

$sql1="UPDATE accessories SET `status` = 'disapprove' WHERE accessories_id = '".trim($disapproved_id)."' and user_id = '".trim($user_id)."'";
$result1=mysql_query($sql1);
*/
/*$sql8 = "select * from accessories where accessories_id='".trim($disapproved_id)."' and user_id='".trim($user_id)."'";
$result8 = mysql_query($sql8);

while($row8 = mysql_fetch_row($result8))
{
$sql9="UPDATE data_card SET `status` = '0' WHERE card_no = '".trim($row8['card_no'])."'";
$result9=mysql_query($sql9);
}*/
$query=mysql_query("Select * from accessories_stock where accessories_id = '".trim($disapproved_id)."'");
	while($queryrow=mysql_fetch_array($query))
	{
		$quantity=$queryrow['quantity'] + 1;
				
		$sql2="UPDATE accessories_stock SET `quantity` = '$quantity' WHERE accessories_id = '".trim($disapproved_id)."'";
		$result2=mysql_query($sql2);
		
	}

echo 'Your Request has been submitted';
?>